package com.cfpl.userinfo.controller;

import com.cfpl.pojo.po.UserInfo;
import com.cfpl.userinfo.dao.UserInfoDao;
import com.cfpl.userinfo.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/userinfo")
public class UserInfoController {
    @Autowired
    private UserInfoService userInfoService;
    @Autowired
    private UserInfoDao userInfoDao;
    @RequestMapping("/query")
    public List<UserInfo> query(){
        return userInfoDao.findAll();
    }

    @RequestMapping("/getOne/{uid}")
    public UserInfo getOne(@PathVariable("uid") int uid){
        return userInfoDao.findById(uid).get();
    }


}
